package com.example.superoa.controller;

import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONArray;
import com.example.superoa.model.service.TinformatService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@Controller
public class TinformatController {
		@Autowired
		private TinformatService forservice;
		
		//查询辅助资料			
		@PostMapping("select-assist")
		@ResponseBody
		public Map<String,Object> show(String tinformatname,int page,int rows) {
			Map<String,Object> map = new HashMap<>();
			//先分页
			Page<Object> pg = PageHelper.startPage(page, rows);
			JSONArray j = forservice.findByTinformatname(tinformatname);
			//总记录
			map.put("total", pg.getTotal());
			//页内容
			map.put("rows", j);
			return map;
		}
}
